#include"Http.hpp"
#include "Server.hpp"

void Reminder(const char *str)
{
    std::cout << "请输入：" << str << " 端口号" << std::endl;
}


int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Reminder(argv[0]);
        exit(0);
    }
    EnableConsolseSyncStrategy();
    std::unique_ptr<Http> http=std::make_unique<Http>();
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<Server> ptr = std::make_unique<Server>(port,[&http](std::string&reqstr)->std::string{
        return http->PackUp(reqstr);
    } );
    ptr->Run();
    return 0;
}